package com.linkage.educloud.ah.bean;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Mr'Tang on 2018/12/17.
 */

public class AppClassify {
    private String groupname;
    private String group_icon;
    private int group_type;
    private int groupid;

    public static List<AppClassify> parseFromJson(JSONArray jsonArray) {
        List<AppClassify> list = new ArrayList<>();
        for (int a = 0; a < jsonArray.length(); a++) {
            AppClassify bean = new AppClassify();
            JSONObject jsonObj = null;
            try {
                jsonObj = jsonArray.getJSONObject(a);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            bean.setGroupname(jsonObj.optString("groupname"));
            bean.setGroup_icon(jsonObj.optString("group_icon"));
            bean.setGroup_type(jsonObj.optInt("group_type"));
            bean.setGroupid(jsonObj.optInt("groupid"));
            list.add(bean);
        }
        return list;
    }

    public String getGroupname() {
        return groupname;
    }

    public void setGroupname(String groupname) {
        this.groupname = groupname;
    }

    public String getGroup_icon() {
        return group_icon;
    }

    public void setGroup_icon(String group_icon) {
        this.group_icon = group_icon;
    }

    public int getGroup_type() {
        return group_type;
    }

    public void setGroup_type(int group_type) {
        this.group_type = group_type;
    }

    public int getGroupid() {
        return groupid;
    }

    public void setGroupid(int groupid) {
        this.groupid = groupid;
    }
}
